package com.qt.thread.homework.test;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @Author zsf
 * @Date 2023/10/4 16:27
 * @Version 1.0
 */
public class Demo {

    public static void main(String[] args) throws ExecutionException, InterruptedException {

        TestCallable tc1 = new TestCallable();
        TestCallable tc2 = new TestCallable();

        FutureTask<String> st1 = new FutureTask<String>(tc1);
        FutureTask<String> st2 = new FutureTask<String>(tc2);

        Thread t1 = new Thread(st1);
        Thread t2 = new Thread(st2);
        t1.start();
        t2.start();

        System.out.println("===================================" + st1.get() + st2.get() + "=========================");

    }

}
